'use strict';
var allTestFiles = [];
var TEST_REGEXP = /spec\.js$/i;

var pathToModule = function(path) {
    return path.replace(/^\/base\//, '').replace(/\.js$/, '');
};

Object.keys(window.__karma__.files).forEach(function(file) {
    if (TEST_REGEXP.test(file)) {  
        // Normalize paths to RequireJS module names.
        allTestFiles.push(pathToModule(file));
    }    
});

require.config({   
    baseUrl: '/base',

    paths: {              
        'jscrollpanel' : 'app/js/vendor/jquery.jscrollpane',
        'react': 'app/js/vendor/react-with-addons',          
        'react.backbone': 'app/js/vendor/react.backbone',   
        'backbone': 'app/js/vendor/backbone',
        'underscore': 'app/js/vendor/lodash.min',  
        'text': 'app/js/vendor/text',
        'json': 'app/js/vendor/json'           
    },
    shim: {
        'underscore': {
            exports: '_'
        }        
    },        
    packages : ["Plugins/Form", "Plugins/Hand", "Plugins/Annot"],
    deps: allTestFiles,
    callback: window.__karma__.start
});
/*
require(['app/js/PDFViewer', 'jquery'], function(PDFViewer, $) {
    var settings = {
       // s3Key: UCX_Utils.getUrlParam("doc")
    };
    var pdfApi = $("#docViewer").pdfViewer(settings).data("jsp");
});
*/



